// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 

package pica.ui;

import c;
import java.util.*;
import javax.microedition.lcdui.*;

// Referenced classes of package pica.ui:
//            b, f, h

public final class e extends b
{

    private e(h h1, String s1, int i1, int j1)
    {
        super(h1, s1);
        N = true;
        bv = 3;
        super.g = i1;
        super.h = j1;
        l = Font.getFont(0, 0, 8);
        m = (byte)l.getHeight();
        n = Font.getFont(0, 1, 8);
        o = (byte)n.getHeight();
        q();
        j();
        d(true);
        l();
        w();
        i();
    }

    private void i()
    {
        bw = new Date();
        bx = Calendar.getInstance();
        by = k();
        bz = System.currentTimeMillis();
    }

    public static synchronized e a(h h1, String s1, int i1, int j1)
    {
        if(i == null)
            i = new e(h1, s1, i1, j1);
        return i;
    }

    public static void a()
    {
        bs = Image.createImage("/middle/msg.png");
        P = Image.createImage("/middle/menu_border.png");
        Q = Image.createImage("/middle/menu_focus_border.png");
        S = (new Image[] {
            Image.createImage("/middle/menu_adom_leftup.png"), Image.createImage("/middle/menu_adom_leftdown.png"), Image.createImage("/middle/menu_adom_rightup.png"), Image.createImage("/middle/menu_adom_rightdown.png")
        });
        T = (new Image[] {
            Image.createImage("/middle/menu_focus_adom_leftup.png"), Image.createImage("/middle/menu_focus_adom_leftdown.png"), Image.createImage("/middle/menu_focus_adom_rightup.png"), Image.createImage("/middle/menu_focus_adom_rightdown.png")
        });
        U = (new Image[] {
            Image.createImage("/middle/menu_arrow_up.png"), Image.createImage("/middle/menu_arrow_down.png"), Image.createImage("/middle/menu_arrow_right.png"), Image.createImage("/middle/menu_arrow_right_focus.png")
        });
        J = Image.createImage("/middle/menubar_bg.png");
        C = Image.createImage("/middle/scrollbar_flute.png");
        D = Image.createImage("/middle/scrollbar_block.png");
        bc = (new Image[] {
            Image.createImage("/middle/pagetab_normal_bg.png"), Image.createImage("/middle/pagetab_focus_bg.png")
        });
        aW = Image.createImage("/middle/topbar_bg.png");
        aX = Image.createImage("/middle/bottombar_bg.png");
        return;
        JVM INSTR dup ;
        Exception exception;
        exception;
        printStackTrace();
    }

    private void j()
    {
        aI = Image.createImage(super.g, aW.getHeight());
        a(aI.getGraphics(), aW, 0, aW.getWidth(), aW.getHeight(), 0, 0, aI.getWidth(), aI.getHeight(), (byte)0);
        aM = Image.createImage(super.g, aX.getHeight());
        a(aM.getGraphics(), aX, 0, aX.getWidth(), aX.getHeight(), 0, 0, aM.getWidth(), aM.getHeight(), (byte)0);
          goto _L1
        JVM INSTR dup ;
        Exception exception;
        exception;
        printStackTrace();
_L1:
        aY = new Vector();
        aN = (short)aM.getHeight();
        aH = (short)(aI.getHeight() + aN);
        ba = (short)((super.f + aI.getHeight()) - bc[1].getHeight());
        aK = (short)(super.f - aH);
        return;
    }

    private String k()
    {
        bw.setTime(System.currentTimeMillis());
        bx.setTime(bw);
        int i1 = bx.get(11);
        int j1;
        String s1 = (j1 = bx.get(12)) >= 10 ? String.valueOf(j1) : "0" + j1;
        String s2 = i1 >= 10 ? String.valueOf(i1) : "0" + i1;
        return s2 + ":" + s1;
    }

    private void b(Graphics g1)
    {
        g1.setFont(l);
        if(I && !br)
        {
            if(System.currentTimeMillis() - bz >= 1000L)
            {
                by = k();
                bz = System.currentTimeMillis();
            }
            a(g1, by, super.g / 2, G + (H - g1.getFont().getHeight()) / 2, 0, 3, 1, 0xffffff, 17);
        }
    }

    public final void a(boolean flag, boolean flag1)
    {
        aL = flag;
        if(!flag1 || !h.g)
            aK = flag ? (short)super.f : (short)(super.f - aH);
        aO = true;
    }

    public final void a(Object aobj[][])
    {
        Y = aobj;
        if(Y != null)
        {
            r();
            return;
        } else
        {
            c(false);
            return;
        }
    }

    private void l()
    {
        R = (short)(m + 6);
    }

    public final void a(String as1[])
    {
        aE = as1;
        if(aE != null)
        {
            m();
            return;
        } else
        {
            a(false);
            return;
        }
    }

    private void m()
    {
        if(N)
            au = (byte)aE.length;
        else
            au = (byte)(4 <= aE.length ? 4 : aE.length);
        aA = (short)(R * au + 20);
        int i1 = 0;
        for(int j1 = 0; j1 < aE.length; j1++)
        {
            String s1 = aE[j1].toString();
            i1 = Math.max(l.stringWidth(s1), i1);
        }

        az = (short)(i1 + 30);
        ax = (short)(super.e + (super.g - az) / 2);
        ay = (short)(super.f + (super.h - aA) / 2);
        aC = a(P, 9, 6, az, aA, 0xffffff, (byte)1);
        aD = a(Q, 9, 6, az - 10, R, 0x438ee0, (byte)1);
    }

    public final void a(boolean flag)
    {
        if(aE == null)
        {
            aF = false;
            return;
        }
        aF = flag;
        aG = aB = 0;
        if(flag)
        {
            if(h.g)
            {
                aw = 0;
                av = (short)(ay + aA / 2);
            } else
            {
                aw = aA;
                av = ay;
            }
            O = true;
        }
    }

    private void c(boolean flag)
    {
        X = flag;
        ae = 0;
        af = 0;
        if(flag)
        {
            j = "\u9009\u62E9";
            K = k;
            k = "\u53D6\u6D88";
            if(h.g)
                ac = (short)super.h;
            else
                ac = aa;
            O = true;
            return;
        }
        if(K != null && !K.equals("\u53D6\u6D88"))
            k = K;
        if(Y != null)
            j = "\u9009\u9879";
        e(false);
    }

    private boolean n()
    {
        if(Y == null)
            X = false;
        return X;
    }

    private boolean o()
    {
        if(aE == null)
            aF = false;
        return aF;
    }

    public final void a(int i1, int j1)
    {
        A = (short)j1;
        q = (short)i1;
        r = 0;
        p();
    }

    private void p()
    {
        d(false);
        d(q);
        a(r);
    }

    public final void b(boolean flag, boolean flag1)
    {
        E = flag;
        if(!flag1 || !h.g)
            t = flag ? s : (short)(super.e + super.g);
        p = true;
    }

    public final void c(boolean flag, boolean flag1)
    {
        if(!flag && Y != null)
            c(false);
        if(!flag1 || !h.g)
            G = flag ? F : (short)(super.f + super.h);
        I = flag;
        L = true;
    }

    private void q()
    {
        H = (short)J.getHeight();
        F = (short)((super.f + super.h) - H);
        G = (short)((super.f + super.h) - 2);
        M = Image.createImage(super.g, H);
        a(M.getGraphics(), J, 0, J.getWidth(), J.getHeight(), 0, 0, super.g, J.getHeight(), (byte)0);
    }

    private void r()
    {
        if(N)
            V = (byte)Y.length;
        else
            V = (byte)(3 <= Y.length ? 3 : Y.length);
        ad = (short)(R * V);
        Z = 0;
        aa = (short)((super.f + super.h) - ad - H - 10);
        ab = (short)super.g;
        if(Y.length > 0)
            j = "\u9009\u9879";
        ag = a(P, 9, 6, ab, ad + 20, 0xffffff, (byte)0);
        ah = a(Q, 9, 6, ab - 10, R, 0x438ee0, (byte)1);
    }

    private void a(Object aobj[])
    {
        int i1 = 0;
        for(int j1 = 0; j1 < aobj.length; j1++)
        {
            String s1 = aobj[j1].toString();
            i1 = Math.max(l.stringWidth(s1), i1);
        }

        ao = (short)aobj.length;
        if(N)
            W = (byte)ao;
        else
            W = (byte)(4 <= ao ? 4 : ao);
        ak = (short)(i1 + 18);
        ai = (short)((super.e + super.g) - ak);
        al = (short)(R * W);
        aj = (short)((super.f + super.h) - al - H - 25);
        ar = a(P, 9, 6, ak, al + 20, 0xffffff, (byte)1);
        as = a(Q, 9, 6, ak - 10, R, 0x438ee0, (byte)1);
    }

    private void d(boolean flag)
    {
        v = 11;
        s = (short)((super.e + super.g) - v);
        u = (short)(aK + aH + 9);
        w = (short)(G - (aK + aH) - 18);
        y = u;
        if(flag)
            t = (short)(super.e + super.g);
        B = null;
        B = Image.createImage(v, w);
        a(B.getGraphics(), C, 2, 11, 9, 0, 0, v, w, (byte)1);
    }

    private void d(int i1)
    {
        q = (short)i1;
        if(q > A)
        {
            z = (short)((w * 100) / q);
            x = (short)((w * A) / q);
            if(x < 5)
            {
                x = 5;
                return;
            }
        } else
        {
            x = 0;
        }
    }

    public final void a(int i1)
    {
        r = (short)i1;
        i1 = Math.abs(i1);
        y = (short)(u + (i1 * z) / 100);
        if(i1 == 0)
            y = u;
        if(i1 >= q - A)
            y = (short)((u + w) - x);
    }

    public final int b()
    {
        return r;
    }

    public final void b(String as1[])
    {
        aY.removeAllElements();
        if(as1 != null)
        {
            for(int i1 = 0; i1 < as1.length; i1++)
            {
                int j1;
                Image image = Image.createImage(j1 = l.stringWidth(as1[i1]) + 10, bc[0].getHeight());
                a(image.getGraphics(), bc[0], 2, 4, bc[0].getHeight(), 0, 0, image.getWidth(), image.getHeight(), (byte)0);
                Image image1 = Image.createImage(j1, bc[1].getHeight());
                a(image1.getGraphics(), bc[1], 2, 4, bc[1].getHeight(), 0, 0, image1.getWidth(), image1.getHeight(), (byte)0);
                aY.addElement(((Object) (new Object[] {
                    as1[i1], new Image[] {
                        image, image1
                    }
                })));
            }

        }
    }

    public final void a(String s1)
    {
        aJ = s1;
    }

    public final void a(Image image, int i1, int j1, int k1, boolean flag)
    {
        aT = image;
        if(image != null)
        {
            aV = flag;
            aR = (short)j1;
            aS = (short)k1;
            aU = (short)i1;
            aP = (short)(super.e + 5);
            aQ = (short)(super.f + (aH - aS - aN) / 2);
            aZ = (short)(aP + aR + 10);
            return;
        } else
        {
            aZ = 0;
            return;
        }
    }

    public final String c()
    {
        return aJ;
    }

    public final void b(int i1)
    {
        bb = (short)i1;
    }

    public final int d()
    {
        return bb;
    }

    public final String c(int i1)
    {
        if(aY.size() == 0)
            return null;
        else
            return ((Object[])aY.elementAt(i1))[0].toString();
    }

    public final int e()
    {
        return q;
    }

    public final int f()
    {
        return A;
    }

    private void s()
    {
        if(p)
            if(E)
            {
                t -= 4;
                if(t < s)
                {
                    t = s;
                    p = false;
                    return;
                }
            } else
            {
                t += 4;
                if(t > super.g)
                {
                    t = (short)super.g;
                    p = false;
                }
            }
    }

    public final int[] g()
    {
        int ai1[];
        return ai1 = (new int[] {
            super.e, aK + aH, t, G - aK - aH
        });
    }

    private void t()
    {
        if(O)
        {
            if(X)
            {
                int i1 = R * 2;
                if(at)
                {
                    am -= i1;
                    if(am < ai)
                    {
                        am = ai;
                        O = false;
                    }
                } else
                {
                    ac -= i1;
                    if(ac < aa)
                    {
                        ac = aa;
                        O = false;
                    }
                }
                return;
            }
            if(aF)
            {
                av -= R;
                if(av <= ay)
                {
                    av = ay;
                    O = false;
                }
                aw += R * 2;
                if(aw > aA)
                {
                    aw = aA;
                    O = false;
                }
            }
        }
    }

    private void u()
    {
        if(aO)
        {
            if(aL)
            {
                aK += aH / 5;
                if(aK > super.f)
                {
                    aK = (short)super.f;
                    aO = false;
                }
            } else
            {
                aK -= aH / 5;
                if(aK < super.f - aH)
                {
                    aK = (short)(super.f - aH);
                    aO = false;
                }
            }
            if(!aO)
                p();
        }
    }

    private void v()
    {
        if(L)
        {
            if(!I)
            {
                G += H / 5;
                if(G > super.h - 2)
                {
                    G = (short)(super.h - 2);
                    L = false;
                }
            } else
            if(I)
            {
                G -= H / 5;
                if(G < F)
                {
                    G = F;
                    L = false;
                }
            }
            if(!L)
                p();
        }
    }

    protected final void a(Graphics g1)
    {
        if(super.d)
        {
            s();
            t();
            v();
            u();
            x();
            h(g1);
            i(g1);
            e(g1);
            f(g1);
            g(g1);
            b(g1);
            d(g1);
            c(g1);
        }
        return;
        JVM INSTR dup ;
        Exception exception;
        exception;
        printStackTrace();
    }

    private void c(Graphics g1)
    {
        if(bd != null && S != null && bg != null)
        {
            g1.setFont(l);
            a(g1, S, bg, bm, bf, (byte)1);
            for(int i1 = 0; i1 < bd.length; i1++)
            {
                g1.setColor(0);
                g1.drawString(bd[i1], bm + 10, bf + i1 * be + 10, 0);
            }

            g1.setColor(0);
            int j1 = (bf + bl) - m - 5;
            if(bh != null)
                g1.drawString(bh, bm + 10, j1, 0);
            if(bi != null)
                g1.drawString(bi, (bm + bk) - 10, j1, 24);
        }
    }

    public final synchronized void a(String s1, String s2, String s3, int i1, Object obj)
    {
        if(s1 != null)
        {
            bp = System.currentTimeMillis();
            bo = i1;
            bd = null;
            bd = pica.ui.f.a(s1, super.g - 20, l);
            bh = s2;
            bi = s3;
            bq = obj;
            bl = (short)(be * bd.length + 20 + m + 5);
            bn = (short)((super.f + super.h) - bl - 5);
            if(h.g)
                bf = (short)(super.f + super.h);
            else
                bf = bn;
            bg = null;
            bg = a(P, 9, 6, bk, bl, 0xffffff, (byte)1);
            bj = true;
            return;
        } else
        {
            bd = null;
            bh = null;
            bi = null;
            return;
        }
    }

    private void w()
    {
        be = (byte)(m + 5);
        bm = 5;
        bk = (short)(super.g - 10);
    }

    private void x()
    {
        if(bd != null)
        {
            if(bj)
            {
                bf -= be;
                if(bf < bn)
                {
                    bf = bn;
                    bj = false;
                }
            }
            if(bo > 0 && bh == null && bi == null && System.currentTimeMillis() - bp >= (long)bo)
                a(((String) (null)), ((String) (null)), ((String) (null)), 0, null);
        }
    }

    public final void b(boolean flag)
    {
        if(!br || !flag)
        {
            br = flag;
            bu = 0;
        }
        if(!h.g)
            bu = bv;
    }

    private void d(Graphics g1)
    {
        if(br)
        {
            if(bt < 5)
            {
                bt++;
            } else
            {
                bt = 0;
                if(bu < bv)
                    bu++;
            }
            if(bt > 0 || bu == bv)
                a(g1, bs, super.g / 2, G + H / 2, 2, 18, 18, 3);
        }
    }

    private void e(Graphics g1)
    {
        g1.setFont(l);
        if(aF)
        {
            g1.setClip(ax, av, az, aw);
            a(g1, S, aC, ax, ay, (byte)1);
            for(int i1 = 0; i1 < au; i1++)
            {
                if(i1 + aG == aB)
                {
                    a(g1, T, aD, ax + 5, ay + R * i1 + 10, (byte)1);
                    g1.setColor(0xffffff);
                } else
                {
                    g1.setColor(0);
                }
                g1.drawString(aE[i1 + aG].toString(), ax + az / 2, ay + (R - m) / 2 + i1 * R + 10, 17);
            }

            if(au < aE.length)
            {
                if(aG + au < aE.length)
                    g1.drawImage(U[1], ax + (az - U[1].getWidth()) / 2, (av + aA) - 9, 0);
                if(aG > 0)
                    g1.drawImage(U[0], ax + (az - U[0].getWidth()) / 2, av + 2, 0);
            }
            g1.setClip(super.e, super.f, super.g, super.h);
        }
    }

    private void f(Graphics g1)
    {
        g1.setFont(l);
        if(X)
        {
            a(g1, S, ag, Z, ac - 10, (byte)0);
            for(int i1 = 0; i1 < V; i1++)
            {
                if(i1 + af == ae)
                {
                    a(g1, T, ah, Z + 5, ac + R * i1, (byte)1);
                    g1.setColor(0xffffff);
                } else
                {
                    g1.setColor(0);
                }
                g1.drawString(Y[i1 + af][1].toString(), Z + 10, ac + (R - m) / 2 + i1 * R, 0);
                if(Y[i1 + af][0] == null)
                    continue;
                Image image;
                if(i1 + af == ae)
                    image = U[3];
                else
                    image = U[2];
                g1.drawImage(image, (Z + ab) - 6, ac + R / 2 + i1 * R, 10);
            }

            if(V < Y.length)
            {
                if(af + V < Y.length)
                    g1.drawImage(U[1], Z + (ab - U[1].getWidth()) / 2, ac + ad + 2, 0);
                if(af > 0)
                    g1.drawImage(U[0], Z + (ab - U[0].getWidth()) / 2, ac - 7, 0);
            }
            if(at)
            {
                a(g1, S, ar, am, aj - 10, (byte)1);
                for(int j1 = 0; j1 < W; j1++)
                {
                    if(j1 + ap == an)
                    {
                        a(g1, T, as, am + 5, aj + j1 * R, (byte)1);
                        g1.setColor(0xffffff);
                    } else
                    {
                        g1.setColor(0);
                    }
                    g1.drawString(aq[j1 + ap].toString(), am + 9, aj + (R - m) / 2 + j1 * R, 0);
                }

                if(W < aq.length)
                {
                    if(ap + W < aq.length)
                        g1.drawImage(U[1], am + (ak - U[1].getWidth()) / 2, aj + al + 2, 0);
                    if(ap > 0)
                        g1.drawImage(U[0], am + (ak - U[0].getWidth()) / 2, aj - 7, 0);
                }
            }
        }
    }

    private void g(Graphics g1)
    {
        g1.setFont(l);
        g1.drawImage(M, 0, G, 0);
        int i1 = G + (H - m);
        if(j != null)
            a(g1, j, 2, i1, 0, 3, 1, 0xffffff, 0);
        if(k != null)
            a(g1, k, super.g - 2, i1, 0, 3, 1, 0xffffff, 24);
    }

    private static void a(Graphics g1, String s1, int i1, int j1, int k1, int l1, int i2, int j2, 
            int k2)
    {
        g1.setColor(j2);
        switch(l1)
        {
        case 0: // '\0'
            g1.drawString(s1, i1 - i2, j1 - i2, k2);
            break;

        case 1: // '\001'
            g1.drawString(s1, i1 - i2, j1 + i2, k2);
            break;

        case 2: // '\002'
            g1.drawString(s1, i1 + i2, j1 - i2, k2);
            break;

        case 3: // '\003'
            g1.drawString(s1, i1 + i2, j1 + i2, k2);
            break;
        }
        g1.setColor(k1);
        g1.drawString(s1, i1, j1, k2);
    }

    private static void a(Graphics g1, Image aimage[], Image aimage1[], int i1, int j1, byte byte0)
    {
        g1.drawImage(aimage1[4], i1 + aimage1[2].getWidth(), j1 + aimage1[0].getHeight(), 0);
        g1.drawImage(aimage1[0], i1 + aimage1[2].getWidth(), j1, 0);
        if(byte0 == 1)
            g1.drawImage(aimage1[1], i1 + aimage1[3].getWidth(), j1 + aimage1[0].getHeight() + aimage1[2].getHeight(), 0);
        g1.drawImage(aimage1[2], i1, j1 + aimage1[0].getHeight(), 0);
        g1.drawImage(aimage1[3], i1 + aimage1[2].getWidth() + aimage1[0].getWidth(), j1 + aimage1[0].getHeight(), 0);
        g1.drawImage(aimage[0], i1, j1, 0);
        g1.drawImage(aimage[2], i1 + aimage1[2].getWidth() + aimage1[0].getWidth(), j1, 0);
        if(byte0 == 1)
        {
            g1.drawImage(aimage[1], i1, j1 + aimage1[0].getHeight() + aimage1[2].getHeight(), 0);
            g1.drawImage(aimage[3], i1 + aimage1[2].getWidth() + aimage1[0].getWidth(), j1 + aimage1[0].getHeight() + aimage1[2].getHeight(), 0);
        }
    }

    private Image[] a(Image image, int i1, int j1, int k1, int l1, int i2, byte byte0)
    {
        Image image2 = null;
        Image image1;
        Graphics g1 = (image1 = Image.createImage(k1 - i1 * 2, j1)).getGraphics();
        a(g1, image, 0, i1, j1, 0, 0, image1.getWidth(), image1.getHeight(), (byte)0);
        Image image3;
        Image image5;
        if(byte0 == 1)
        {
            Graphics g2 = (image2 = Image.createImage(image1.getWidth(), image1.getHeight())).getGraphics();
            a(g2, image, 1, i1, j1, 0, 0, image2.getWidth(), image2.getHeight(), (byte)0);
            image5 = Image.createImage(k1 - i1 * 2, l1 - j1 * 2);
            image3 = Image.createImage(i1, l1 - j1 * 2);
        } else
        {
            image5 = Image.createImage(k1 - i1 * 2, l1 - j1);
            image3 = Image.createImage(i1, l1 - j1);
        }
        Graphics g5;
        (g5 = image5.getGraphics()).setColor(i2);
        g5.fillRect(0, 0, image5.getWidth(), image5.getHeight());
        Graphics g3 = image3.getGraphics();
        a(g3, image, 2, i1, j1, 0, 0, image3.getWidth(), image3.getHeight(), (byte)1);
        Image image4;
        Graphics g4 = (image4 = Image.createImage(image3.getWidth(), image3.getHeight())).getGraphics();
        a(g4, image, 3, i1, j1, 0, 0, image4.getWidth(), image4.getHeight(), (byte)1);
        return (new Image[] {
            image1, image2, image3, image4, image5
        });
    }

    private void h(Graphics g1)
    {
        g1.drawImage(B, t, u, 0);
        if(x > 0)
        {
            a(g1, D, 2, 9, 4, t + 1, y + 4, 9, x - 8, (byte)1);
            a(g1, D, t + 1, y, 0, 9, 4, 0);
            a(g1, D, t + 1, (y + x) - 4, 1, 9, 4, 0);
        }
        a(g1, C, t, u - 9, 0, 11, 9, 0);
        a(g1, C, t, u + w, 1, 11, 9, 0);
    }

    private void i(Graphics g1)
    {
        g1.drawImage(aI, super.e, aK, 0);
        g1.drawImage(aM, super.e, (aK + aH) - aN, 0);
        if(aT != null)
        {
            if(aV)
            {
                g1.setColor(0xffffff);
                g1.fillRect(aP - 2, (aK + aQ) - 2, aR + 3, aS + 3);
                g1.setColor(0xa4c7ed);
                g1.drawRect(aP - 2, (aK + aQ) - 2, aR + 3, aS + 3);
            }
            a(g1, aT, aP, aK + aQ, aU, aR, aS, 0);
        }
        g1.setFont(l);
        g1.setColor(0);
        int i1 = 0;
        for(int j1 = 0; j1 < aY.size(); j1++)
        {
            Object aobj[] = (Object[])aY.elementAt(j1);
            int k1 = bb != j1 ? 0 : 1;
            Image image;
            int l1 = (image = ((Image[])aobj[1])[k1]).getWidth() + 8;
            int i2 = aZ + i1;
            a(g1, image, bc[k1], i2, aK + ba + (bb != j1 ? 3 : 2));
            g1.drawString(aobj[0].toString(), i2 + l1 / 2, aK + ba + (bb != j1 ? 3 : 1) + (image.getHeight() - o) / 2, 17);
            i1 += l1;
        }

        if(aJ != null)
        {
            g1.setColor(0);
            g1.drawString(aJ, super.e + super.g / 2, aK + (aH - aN - m) / 2, 17);
        }
    }

    private void a(Graphics g1, Image image, Image image1, int i1, int j1)
    {
        g1.drawImage(image, i1 + 4, j1, 0);
        a(g1, image1, i1, j1, 0, 4, image1.getHeight(), 0);
        a(g1, image1, i1 + image.getWidth() + 4, j1, 1, 4, image1.getHeight(), 0);
    }

    private void y()
    {
        if(aB > 0)
        {
            if(aG > 0 && aB <= aG)
                aG--;
            aB--;
            return;
        } else
        {
            aB = (short)(aE.length - 1);
            aG = (short)(aE.length - au);
            return;
        }
    }

    private void z()
    {
        if(aB < aE.length - 1)
        {
            if(aB >= (aG + au) - 1)
                aG++;
            aB++;
            return;
        } else
        {
            aG = aB = 0;
            return;
        }
    }

    private void A()
    {
        if(at)
            if(an > 0)
            {
                if(ap > 0 && an <= ap)
                    ap--;
                an--;
                return;
            } else
            {
                an = (short)(ao - 1);
                ap = (short)(ao - W);
                return;
            }
        if(ae > 0)
        {
            if(af > 0 && ae <= af)
                af--;
            ae--;
            return;
        } else
        {
            ae = (short)(Y.length - 1);
            af = (short)(Y.length - V);
            return;
        }
    }

    private void B()
    {
        if(at)
            if(an < ao - 1)
            {
                if(an >= (ap + W) - 1)
                    ap++;
                an++;
                return;
            } else
            {
                ap = an = 0;
                return;
            }
        if(ae < Y.length - 1)
        {
            if(ae >= (af + V) - 1)
                af++;
            ae++;
            return;
        } else
        {
            af = ae = 0;
            return;
        }
    }

    private void C()
    {
        if(super.a != null)
            super.a.a(7, aE[aB]);
        a(false);
    }

    private void D()
    {
        if(!at)
        {
            if(!e(true))
            {
                if(super.a != null)
                    super.a.a(7, Y[ae][1]);
                c(false);
                return;
            }
        } else
        {
            if(super.a != null)
                super.a.a(7, aq[an]);
            c(false);
        }
    }

    public final void b(String s1)
    {
        if(Y != null && s1 == null)
        {
            j = null;
            K = null;
            a((Object[][])null);
            return;
        }
        if(Y != null && s1 != null)
        {
            j = s1;
            a((Object[][])null);
            return;
        } else
        {
            j = s1;
            return;
        }
    }

    public final void c(String s1)
    {
        k = s1;
    }

    protected final boolean a(byte byte0, int i1)
    {
        boolean flag = false;
        if(byte0 == 0)
        {
            if(bd != null)
                flag = true;
            if(o())
            {
                flag = true;
                if(i1 != -1 && i1 != -2)
                {
                    if(i1 == -5 && super.a != null)
                        super.a.a(7, aE[aB]);
                    a(false);
                    return true;
                }
            }
            if(i1 == -6)
            {
                if(bd != null)
                {
                    if(bh != null)
                    {
                        Object obj = bq;
                        a(((String) (null)), ((String) (null)), ((String) (null)), 0, null);
                        if(super.a != null)
                            super.a.a(10, ((Object) (new Object[] {
                                new Boolean(true), obj
                            })));
                    }
                } else
                if(I)
                    if(j != null && !j.equals("\u9009\u9879") && !j.equals("\u9009\u62E9"))
                    {
                        if(super.a != null)
                            super.a.a(7, j);
                        flag = true;
                    } else
                    if(Y != null)
                    {
                        if(!n())
                            c(true);
                        else
                            D();
                        flag = true;
                    }
            } else
            if(i1 == -7)
            {
                if(bd != null)
                {
                    if(bi != null)
                    {
                        Object obj1 = bq;
                        a(((String) (null)), ((String) (null)), ((String) (null)), 0, null);
                        if(super.a != null)
                            super.a.a(10, ((Object) (new Object[] {
                                new Boolean(false), obj1
                            })));
                    }
                } else
                if(I)
                    if(n())
                    {
                        c(false);
                        flag = true;
                    } else
                    if(k != null)
                    {
                        if(super.a != null)
                            super.a.a(7, k);
                        flag = true;
                    }
            } else
            if(i1 == -1 || i1 == 50)
            {
                if(bd == null)
                    if(n())
                    {
                        A();
                        flag = true;
                    } else
                    if(o())
                    {
                        y();
                        flag = true;
                    }
            } else
            if(i1 == -2 || i1 == 56)
            {
                if(bd == null)
                    if(n())
                    {
                        B();
                        flag = true;
                    } else
                    if(o())
                    {
                        z();
                        flag = true;
                    }
            } else
            if(i1 == -4 || i1 == 54)
            {
                if(bd == null)
                    if(n())
                    {
                        e(true);
                        flag = true;
                    } else
                    if(aL && aY.size() > 0)
                    {
                        F();
                        flag = true;
                    }
            } else
            if(i1 == -3 || i1 == 52)
            {
                if(bd == null)
                    if(n())
                    {
                        e(false);
                        flag = true;
                    } else
                    if(aL && aY.size() > 0)
                    {
                        E();
                        flag = true;
                    }
            } else
            if(i1 == -5 || i1 == 53)
            {
                if(bd == null)
                    if(n())
                    {
                        D();
                        flag = true;
                    } else
                    if(o())
                    {
                        C();
                        flag = true;
                    }
            } else
            if(i1 == 42 || i1 == 35)
                super.a.a(16, new Integer(i1));
        }
        return flag;
    }

    private void E()
    {
        bb--;
        if(bb < 0)
            bb = (short)(aY.size() - 1);
        if(super.a != null)
            super.a.a(8, ((Object[])aY.elementAt(bb))[0]);
    }

    private void F()
    {
        bb++;
        if(bb > aY.size() - 1)
            bb = 0;
        if(super.a != null)
            super.a.a(8, ((Object[])aY.elementAt(bb))[0]);
    }

    private boolean e(boolean flag)
    {
        if(Y == null)
        {
            at = false;
            return false;
        }
        Object obj;
        if((obj = Y[ae][0]) != null)
        {
            if(flag)
            {
                if(!at)
                {
                    ap = an = 0;
                    if(h.g)
                        am = (short)super.g;
                    else
                        am = ai;
                    a(aq = (Object[])obj);
                }
                at = true;
                O = true;
                return true;
            }
            at = false;
            aq = null;
        }
        at = false;
        return at;
    }

    private static int b(int i1, int j1)
    {
        if(i1 % j1 == 0)
            return i1 / j1;
        else
            return i1 / j1 + 1;
    }

    private void a(Graphics g1, Image image, int i1, int j1, int k1, int l1, int i2, 
            int j2, int k2, byte byte0)
    {
        if(byte0 == 0)
        {
            int l2 = b(j2, j1);
            for(int j3 = 0; j3 < l2; j3++)
                a(g1, image, l1 + j3 * j1, i2, i1, j1, k1, 0);

            return;
        }
        if(byte0 == 1)
        {
            int i3 = b(k2, k1);
            for(int k3 = 0; k3 < i3; k3++)
                a(g1, image, l1, i2 + k3 * k1, i1, j1, k1, 0);

        }
    }

    private void a(Graphics g1, Image image, int i1, int j1, int k1, int l1, int i2, 
            int j2)
    {
        if((j2 & 8) == 8)
            i1 -= l1;
        if((j2 & 0x20) == 32)
            j1 -= i2;
        if((j2 & 1) == 1)
            i1 -= l1 / 2;
        if((j2 & 2) == 2)
            j1 -= i2 / 2;
        int k2 = image.getWidth() / l1;
        int l2 = k1 % k2;
        int i3 = (k1 - l2) / k2;
        g1.setClip(i1, j1, l1, i2);
        g1.drawImage(image, i1 - l2 * l1, j1 - i3 * i2, 0);
        g1.setClip(super.e, super.f, super.g, super.h);
    }

    protected final boolean a(byte byte0, int i1, int j1)
    {
        if(byte0 == 0)
            return c(i1, j1);
        if(byte0 == 1)
            return G();
        else
            return false;
    }

    private boolean G()
    {
        return false;
    }

    private boolean c(int i1, int j1)
    {
        boolean flag = false;
        if(!bj && bd != null)
        {
            if(bh != null && pica.ui.f.a(i1, j1, bm, bn, 40, bl))
                flag = a((byte)0, -6);
            else
            if(bi != null && pica.ui.f.a(i1, j1, (bm + bk) - 40, bn, 40, bl))
                flag = a((byte)0, -7);
        } else
        if(!O && aF)
        {
            if(pica.ui.f.a(i1, j1, ax, ay, az, aA))
            {
                int k1 = 0;
                do
                {
                    if(k1 >= au)
                        break;
                    if(pica.ui.f.a(i1, j1, ax, ay + k1 * R + 10, az, R))
                    {
                        aB = (short)(k1 + aG);
                        H();
                        flag = a((byte)0, -5);
                        break;
                    }
                    k1++;
                } while(true);
            } else
            {
                a(false);
                flag = true;
            }
        } else
        if(!L && I)
            if(pica.ui.f.a(i1, j1, 0, F, 40, H))
                flag = a((byte)0, -6);
            else
            if(pica.ui.f.a(i1, j1, super.g - 40, F, 40, H))
                flag = a((byte)0, -7);
            else
            if(!O && X)
            {
                if(at && pica.ui.f.a(i1, j1, ai, aj, ak, al))
                {
                    int l1 = 0;
                    do
                    {
                        if(l1 >= W)
                            break;
                        if(pica.ui.f.a(i1, j1, ai, aj + l1 * R, ak, R))
                        {
                            an = (short)(l1 + ap);
                            H();
                            flag = a((byte)0, -6);
                            break;
                        }
                        l1++;
                    } while(true);
                } else
                if(pica.ui.f.a(i1, j1, Z, aa, ab, ad))
                {
                    if(at)
                    {
                        e(false);
                        flag = true;
                    } else
                    {
                        int i2 = 0;
                        do
                        {
                            if(i2 >= V)
                                break;
                            if(pica.ui.f.a(i1, j1, Z, aa + i2 * R, ab, R))
                            {
                                ae = (short)(i2 + af);
                                H();
                                flag = a((byte)0, -6);
                                break;
                            }
                            i2++;
                        } while(true);
                    }
                } else
                {
                    c(false);
                    flag = true;
                }
            } else
            if(!aO && pica.ui.f.a(i1, j1, 0, 0, super.g, aH))
            {
                int j2 = 0;
                int k2 = 0;
                do
                {
                    if(k2 >= aY.size())
                        break;
                    Object aobj[];
                    Image image;
                    int l2 = (image = ((Image[])(aobj = (Object[])aY.elementAt(k2))[1])[0]).getWidth() + 8;
                    if(pica.ui.f.a(i1, j1, aZ + j2, ba, l2, image.getHeight()))
                    {
                        bb = (short)k2;
                        if(super.a != null)
                            super.a.a(8, ((Object[])aY.elementAt(bb))[0]);
                        flag = true;
                        break;
                    }
                    j2 += l2;
                    k2++;
                } while(true);
            }
        return flag;
    }

    private void H()
    {
        super.b.repaint();
        super.b.serviceRepaints();
    }

    public final void h()
    {
        b(((String) (null)));
        c(((String) (null)));
        c(false, false);
        b(((String []) (null)));
        b(0);
        a(((String) (null)));
        a(((Image) (null)), 0, 0, 0, false);
        a(false, false);
        a(((String []) (null)));
        a(false);
        a(((String) (null)), ((String) (null)), ((String) (null)), 0, null);
        b(false, false);
    }

    private static e i;
    private String j;
    private String k;
    private Font l;
    private byte m;
    private Font n;
    private byte o;
    private boolean p;
    private short q;
    private short r;
    private short s;
    private short t;
    private short u;
    private short v;
    private short w;
    private short x;
    private short y;
    private short z;
    private short A;
    private Image B;
    private static Image C;
    private static Image D;
    private boolean E;
    private short F;
    private short G;
    private short H;
    private boolean I;
    private static Image J;
    private String K;
    private boolean L;
    private Image M;
    private boolean N;
    private boolean O;
    private static Image P;
    private static Image Q;
    private short R;
    private static Image S[];
    private static Image T[];
    private static Image U[];
    private byte V;
    private byte W;
    private boolean X;
    private Object Y[][];
    private short Z;
    private short aa;
    private short ab;
    private short ac;
    private short ad;
    private short ae;
    private short af;
    private Image ag[];
    private Image ah[];
    private short ai;
    private short aj;
    private short ak;
    private short al;
    private short am;
    private short an;
    private short ao;
    private short ap;
    private Object aq[];
    private Image ar[];
    private Image as[];
    private boolean at;
    private byte au;
    private short av;
    private short aw;
    private short ax;
    private short ay;
    private short az;
    private short aA;
    private short aB;
    private Image aC[];
    private Image aD[];
    private String aE[];
    private boolean aF;
    private short aG;
    private short aH;
    private Image aI;
    private String aJ;
    private short aK;
    private boolean aL;
    private Image aM;
    private short aN;
    private boolean aO;
    private short aP;
    private short aQ;
    private short aR;
    private short aS;
    private Image aT;
    private short aU;
    private boolean aV;
    private static Image aW;
    private static Image aX;
    private Vector aY;
    private short aZ;
    private short ba;
    private short bb;
    private static Image bc[];
    private String bd[];
    private byte be;
    private short bf;
    private Image bg[];
    private String bh;
    private String bi;
    private boolean bj;
    private short bk;
    private short bl;
    private short bm;
    private short bn;
    private int bo;
    private long bp;
    private Object bq;
    private boolean br;
    private static Image bs;
    private byte bt;
    private byte bu;
    private byte bv;
    private Date bw;
    private Calendar bx;
    private String by;
    private long bz;
}
